import React from 'react'
import { useNavigate } from 'react-router-dom'
function UseToken() {
    const nav=useNavigate()
    const token=localStorage.getItem('token')
    if(token){
        return token
    }else{
        return nav('/login')
    }
}
export default UseToken